Window.ConstructContextualMenu Event

Fires whenever it is appropriate to display a ContextualMenu for the control. This is the recommended way to handle contextual menus because this event figures out whether the user has requested the contextual menu, regardless of how he did it.

Syntax

ConstructContextualMenu ( Base, x, y )

Parameters

Base

MenuItem

x

Integer

y

Integer


Returns a Boolean. Base is analogous to the menu bar for the contextual menu. Any items you add to Base will be shown as menu items. If you return False, the event is passed up the parent hierarchy. If you return True, the contextual menu is displayed. The parameters x and y are the mouse locations. If the event was fired because of a non-mouse event, then x and y are both set to -1. See the example of a contextual menu in the examples for the RectControl class.